package com.zrq.xfdemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import com.iflytek.cloud.InitListener;
import com.iflytek.cloud.SpeechRecognizer;
import com.iflytek.cloud.ui.RecognizerDialog;

import java.util.HashMap;
import java.util.LinkedHashMap;

public class RcognizerActivity extends AppCompatActivity {

    private static String TAG=RcognizerActivity.class.getSimpleName();

    //识别结果
    private TextView resultTv;

    //用HashMap存储听写结果
    private HashMap<String,String> mResults=new LinkedHashMap<>();

    //语音听写对象
    private SpeechRecognizer mIat;

    //语音听写UI
    private RecognizerDialog mIatDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rcognizer);

        resultTv= (TextView) findViewById(R.id.RcognizerTv);

        initVoice();
    }

    //初始化
    private void initVoice() {
        mIat=SpeechRecognizer.createRecognizer(this, new InitListener() {
            @Override
            public void onInit(int i) {

            }
        });
    }

    public void click(View view) {

    }
}
